/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * @author wangyaoxi
 * Date: 2010-7-21 下午04:05:11
 */
package com.ccxe.manage.dao;

import java.util.List;
import java.util.Map;
import java.util.Vector;

import com.ccxe.manage.service.page.bean.PageBean;
import com.ccxe.manage.util.help.DaoHelper;

/**
 * 分页抽象dao
 * 
 * @author wangyx
 * 
 */
public abstract class AbstractPageDao {

	private DaoHelper dHelp = new DaoHelper();

	protected String pageSql;

	protected Vector<String> pageParams = new Vector<String>();

	/**
	 * @throws Exception
	 * 
	 */
	public List<Map<?, ?>> initPageList(PageBean pb, Map<String, String> map)
			throws Exception {
		this.buildSqlParameters(map);
		return dHelp.getListByPage(pb, pageSql, pageParams.toArray());
	}

	/**
	 * 子类实现该方法,更新pageSql和pageParams
	 * 
	 * @param map
	 */
	protected abstract void buildSqlParameters(Map<String, String> map) ;

}
